<script>
$('document').ready(function(){
		$(document).on('change', '.airlines', function() {
// 		showLoading();
		//update the airlines list
		if (this.checked)
		{
			//checkbox is checked
			var checkedValue = $(this).val();
			console.log(checkedValue+ " is checked");
			$.each(jsonAirlines,function(index, carriers) {
				 if (carriers.name == checkedValue) {
			        	//carrier already exist in list, just increase amount of carrier
			        	carriers.check=true;
			       }
			});
		}
		else
		{
			//checkbox is unchecked
			var uncheckedValue = $(this).val();
			console.log(uncheckedValue+ " is unchecked");
			$.each(jsonAirlines,function(index, carriers) {
				 if (carriers.name == uncheckedValue) {
			        	//carrier already exist in list, mark it is unchecked
			        	carriers.check=false;
			      }
			});
		}
		//re load data
		console.log("slider_airline: flightResult IN = " + flightResult.length);
		flightResult=response.filter(function(e){
			return compare(e);
		});
		console.log("slider_airline: flightResult OUT = " + flightResult.length);
// 		if (flightResult.length == 0) {
// 			var index=response.length;				
// 			ajaxRequest(index, 10, sortIndex, true);
// 		}
// 		else {
// 			autoSendAjaxRequest();
// 			unShowLoading();
// 		}
		autoSendAjaxRequest(5,JSON.stringify(jsonAirlines),"");
		unShowLoading();
	});
});
</script>